<template>
  <div id="app">
  	 <v-heady :seller="seller" ></v-heady>
     <div class="tab border-bottom">
     	 <div class="tab-item"><router-link to="/goods">商品</router-link></div>
     	 <div class="tab-item"><router-link to="/ratings">评论</router-link></div>
     	 <div class="tab-item"><router-link to="/seller">商家</router-link></div>
     </div>
     <div class="content"></div>
     <keep-alive exclude="Ratings">
         <router-view :seller="seller" ></router-view>
     </keep-alive>
  </div>
</template>

<script>
import heady from '@/components/header/header';
import {urlParse} from '@/common/js/util';
import axios from 'axios'
export default {
  name: 'App',
  data(){
	  return{
		seller:{
		     id:(()=>{ //收藏图标
		     	  let queryParam=urlParse()
						console.log('queryParam',queryParam)
						return queryParam.id;
		     })()
	  	}
	  }
  },
  components: {
   'v-heady':heady
  },
  created() {
	   this.getgomeinfo()
   },
   methods:{
		getgomeinfo(){
			axios.get('../../static/data.json')
			.then(this.gethomrinfosuc)
		},
		gethomrinfosuc(res){
			res=res.data;
//			console.log(res)
			if(res.seller&&res){
				this.seller=res.seller;
//				console.log(this.seller)
        //给对象直接赋值
//      this.seller=Object.assign({},this.seller,res.data)
		  }
    }
   }
}


</script>

<style lang="stylus" rel="stylesheet/stylus">
  @import "./common/stylus/mixin.styl"

  .tab
    display: flex
    width: 100%
    height: 40px
    line-height: 40px
    // border-bottom: 1px solid rgba(7, 17, 27, 0.1)
    border-1px(rgba(7, 17, 27, 0.1))
    .tab-item
      flex: 1
      text-align: center
      & > a
        display: block
        font-size: 14px
        color: rgb(77, 85, 93)
        &.active
          color: rgb(240, 20, 20)
</style>
